package org.jaaksi.test.jpush.util;

import com.alibaba.fastjson.JSON;

import java.util.List;

/**
 * Created by Fcy on 2016/1/23.
 */
public class DataUtil {
    public static <T> T getBean(String json, Class<T> clas) {
        return JSON.parseObject(json, clas);
    }

    public static <T> List<T> getListBean(String jsonArray, Class<T> clas) {
        return JSON.parseArray(jsonArray, clas);
    }

    public static String toJsonString(Object obj) {
        return JSON.toJSONString(obj);
    }
}
